<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>酒店房间查看</title>
</head>
<link href="CSS/HomePage.css" type="text/css" rel="stylesheet">
<link href="CSS/jquery-ui.min.css" type="text/css" rel="stylesheet">
<link href="CSS/owl.carousel.min.css" rel="stylesheet" type="text/css">
<link href="CSS/list.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/jquery-3.6.0.js"></script>
<script type="text/javascript" src="js/jquery-1.12.1.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.pagination.js"></script>

<script src="js/axios-0.18.0.js"></script>

<body>
<script>
    window.onload=function (){

        function getRoomState(rstateid){
            if (rstateid==1){
                return "空房";
            }else if (rstateid==2){
                return "预定";
            }else if (rstateid==3){
                return "满";
            }else {
                return "待维修";
            }
        }

        axios({
            method: 'get',
            url: '/RoomController'
        }).then(function (resp) {
            if (resp){
                var allRoomInfo=resp.data.data;
                var tbody=document.getElementById("allRoomBody");

                for (var i=0;i<allRoomInfo.length-1;i++){
                    for (var j=i+1;j<allRoomInfo.length;j++){
                        if (allRoomInfo[i].id>allRoomInfo[j].id){
                            var temp=allRoomInfo[i];
                            allRoomInfo[i]=allRoomInfo[j];
                            allRoomInfo[j]=temp;
                        }
                    }
                }

                for (var i=0;i<allRoomInfo.length;i++){
                    // var li =document.createElement("li");
                    // li.innerHTML='guestRoomLevelID=>'+allRoomInfo[i].guestRoomLevelID
                    // +'\tguestRoomLevelName=>'+allRoomInfo[i].guestRoomLevelID
                    // +'\tid=>'+allRoomInfo[i].id
                    // +'\troomAmount=>'+allRoomInfo[i].roomAmount
                    // +'\troomNumber=>'+allRoomInfo[i].roomNumber
                    // +'\troomState=>'+allRoomInfo[i].roomState
                    // +'\troomStateID=>'+allRoomInfo[i].roomStateID
                    // +'\tstandardPriceDay=>'+allRoomInfo[i].standardPriceDay;
                    // ul.appendChild(li);
                    tbody.children[i].children[0].innerHTML=allRoomInfo[i].id;
                    // tbody.children[i].children[1].innerHTML
                    tbody.children[i].children[2].innerHTML=getRoomState(allRoomInfo[i].roomStateID);
                    tbody.children[i].children[3].innerHTML=allRoomInfo[i].roomNumber;
                    tbody.children[i].children[4].innerHTML=allRoomInfo[i].roomAmount;
                    tbody.children[i].children[5].innerHTML=allRoomInfo[i].standardPriceDay;
                }
            }else {
                alert("请求失败！");
            }
        });
    }
</script>

<!--  TODO 完成美化填入工作  -->
<div class="pg_qt">
    <div class="pg">
        <div class="pg_top">
            <div class="logo">
                <div class="lg"><img src="images/logopic.jpg" alt="香格里拉酒店" title="香格里拉酒店"></div>
                <div class="star">&nbsp;★★★★★</div>
            </div>
            <div class="htitle">
                <h1>酒店房间预览</h1></br>
                <span class="htitleEn">ShANGRI-LA Business Hotel </span>
            </div>
            <div class="htopr">
                <div class="registe">
                    </br>
                    <h2> <a href="qiantai.html">返回前台</a></h2>
                </div>
                <br><br>
                <br>
                <div class="address">地址：南京市玄武区孝陵卫XXX号XXX街道</div>
                <div class="address" style="font-weight: bold"></div>
            </div>
        </div>
    </div>
</div>
<div class="pg">
    <div class="hc">
        <table id="tablelist" align="center">
            <thead>
            <tr>
                <th>序号ID</th>
                <th>房间名称</th>
                <th>房间状态</th>
                <th>房间号</th>
                <th>房间床位数</th>
                <th>价格</th>
            </tr>
            </thead>
            <tbody onclick="getSelectLine()" id="allRoomBody">
            <tr>
                <td>1</td>
                <td>特惠标准间</td>
                <td></td>
                <td>101</td>
                <td>1</td>
                <td>112</td>
            </tr>
            <tr class="odd">
                <td>2</td>
                <td>特惠标准间</td>
                <td></td>
                <td>102</td>
                <td>1</td>
                <td>112</td>
            </tr>
            <tr>
                <td>3</td>
                <td>特惠标准间</td>
                <td></td>
                <td>103</td>
                <td>1</td>
                <td>112</td>
            </tr>
            <tr class="odd">
                <td>4</td>
                <td>特惠标准间</td>
                <td></td>
                <td>104</td>
                <td>1</td>
                <td>112</td>
            </tr>
            <tr>
                <td>5</td>
                <td>特惠标准间</td>
                <td></td>
                <td>105</td>
                <td>1</td>
                <td>112</td>
            </tr>
            <tr class="odd">
                <td>6</td>
                <td>雅居大床房</td>
                <td></td>
                <td>106</td>
                <td>1</td>
                <td>128</td>
            </tr>
            <tr>
                <td>7</td>
                <td>雅居大床房</td>
                <td></td>
                <td>107</td>
                <td>1</td>
                <td>128</td>
            </tr>
            <tr class="odd">
                <td>8</td>
                <td>雅居大床房</td>
                <td></td>
                <td>108</td>
                <td>1</td>
                <td>128</td>
            </tr>
            <tr>
                <td>9</td>
                <td>雅居大床房</td>
                <td></td>
                <td>109</td>
                <td>1</td>
                <td>128</td>
            </tr>
            <tr class="odd">
                <td>10</td>
                <td>雅居大床房</td>
                <td></td>
                <td>201</td>
                <td>1</td>
                <td>128</td>
            </tr>
            <tr>
                <td>11</td>
                <td>雅居大床房</td>
                <td></td>
                <td>202</td>
                <td>1</td>
                <td>128</td>
            </tr>
            <tr class="odd">
                <td>12</td>
                <td>私人观影院</td>
                <td></td>
                <td>203</td>
                <td>1</td>
                <td>125</td>
            </tr>
            <tr>
                <td>13</td>
                <td>私人观影院</td>
                <td></td>
                <td>204</td>
                <td>1</td>
                <td>125</td>
            </tr>
            <tr class="odd">
                <td>14</td>
                <td>私人观影院</td>
                <td></td>
                <td>205</td>
                <td>1</td>
                <td>125</td>
            </tr>
            <tr>
                <td>15</td>
                <td>迷你单人间</td>
                <td></td>
                <td>206</td>
                <td>1</td>
                <td>127</td>
            </tr>
            <tr class="odd">
                <td>16</td>
                <td>迷你单人间</td>
                <td></td>
                <td>301</td>
                <td>1</td>
                <td>127</td>
            </tr>
            <tr>
                <td>17</td>
                <td>迷你单人间</td>
                <td></td>
                <td>302</td>
                <td>1</td>
                <td>127</td>
            </tr>
            <tr class="odd">
                <td>18</td>
                <td>情侣大床房</td>
                <td></td>
                <td>303</td>
                <td>1</td>
                <td>134</td>
            </tr>
            <tr>
                <td>19</td>
                <td>情侣大床房</td>
                <td></td>
                <td>304</td>
                <td>1</td>
                <td>134</td>
            </tr>
            <tr class="odd">
                <td>20</td>
                <td>情侣大床房</td>
                <td></td>
                <td>305</td>
                <td>1</td>
                <td>134</td>
            </tr>
            <tr>
                <td>21</td>
                <td>行政标准间</td>
                <td></td>
                <td>306</td>
                <td>1</td>
                <td>170</td>
            </tr>
            <tr class="odd">
                <td>22</td>
                <td>行政标准间</td>
                <td></td>
                <td>401</td>
                <td>1</td>
                <td>170</td>
            </tr>
            <tr>
                <td>23</td>
                <td>行政标准间</td>
                <td></td>
                <td>402</td>
                <td>1</td>
                <td>170</td>
            </tr>
            <tr class="odd">
                <td>24</td>
                <td>娱乐棋牌室</td>
                <td></td>
                <td>403</td>
                <td>1</td>
                <td>194</td>
            </tr>
            <tr>
                <td>25</td>
                <td>娱乐棋牌室</td>
                <td></td>
                <td>404</td>
                <td>1</td>
                <td>194</td>
            </tr>
            <tr class="odd">
                <td>26</td>
                <td>亲子房</td>
                <td></td>
                <td>405</td>
                <td>1</td>
                <td>195</td>
            </tr>
            <tr>
                <td>27</td>
                <td>亲子房</td>
                <td></td>
                <td>406</td>
                <td>1</td>
                <td>195</td>
            </tr>
            </tbody>
        </table>
<!--        <script type="text/javascript">-->
<!--            $(function(){-->
<!--                var $table=$("#tablelist"),-->
<!--                    currentPage=0;-->
<!--                var pageSize=6;-->
<!--                $table.bind('paging',function(){-->
<!--                    $table.find('tbody tr').hide().slice(currentPage*pageSize,(currentPage+1)*pageSize).show();-->
<!--                });-->
<!--                var sumRows=$table.find('tbody tr').length;-->
<!--                var sumPages=Math.ceil(sumRows/pageSize);-->
<!--                var $pager=$("<div class='pagin'></div>");-->
<!--                for(var pageindex=0;pageindex<sumPages;pageindex++){-->
<!--                    //为页标签加上链接-->
<!--                    $('<a href="#"><span>'+(pageindex+1)+'</span></a>').bind('click',{"newpage":pageindex},function(event){-->
<!--                        currentPage=event.data["newpage"];-->
<!--                        $table.trigger('paging');-->
<!--                    }).appendTo($pager);-->

<!--                    $pager.append(' ');-->
<!--                }-->
<!--                $pager.insertAfter($table);-->
<!--                $table.trigger('paging');-->
<!--            })-->

<!--        </script>-->
    </div>
</div>
</body>
</html>